﻿using System;
using System.Collections.Generic;


public class PurchaseOrderController
{
    public bool SavePurchaseOrder(string itemName, DateTime orderDate, long itemQuantity, decimal price, bool isCredit, string userId)
    {
        bool succes = true;
        PurchaseOrderInfo purchaseOrder = new PurchaseOrderInfo();
        purchaseOrder.ItemName = itemName;
        purchaseOrder.Itemquantity = itemQuantity;
        purchaseOrder.PurchaseOrderDate = orderDate;
        purchaseOrder.Price = price;
        purchaseOrder.IsCredit = isCredit;

        PurchaseOrderFacade purchaseOrderFacade = new PurchaseOrderFacade();
        purchaseOrderFacade.AddPurchaseOrderCreation(purchaseOrder, userId);
        return succes;
    }
    public bool SubmitPurchaseOrder(PurchaseOrderInfo purchaseOrderInfo, string userId)
    {
        PurchaseOrderFacade purchaseOrderFacade = new PurchaseOrderFacade();
        purchaseOrderFacade.SubmitPurchaseOrder(purchaseOrderInfo, userId);
        return true;
    }
    public bool RejectedFromROLValidation(PurchaseOrderInfo purchaseOrderInfo, string userId)
    {
        PurchaseOrderFacade purchaseOrderFacade = new PurchaseOrderFacade();
        purchaseOrderFacade.RejectedFromROLValidation(purchaseOrderInfo, userId);
        return true;
    }

    public bool SubmitPurchaseQuantityRequest(PurchaseOrderInfo purchaseOrderInfo, string userId)
    {
        PurchaseOrderFacade purchaseOrderFacade = new PurchaseOrderFacade();
        purchaseOrderFacade.SubmitPurchaseQuantityRequest(purchaseOrderInfo, userId);
        return true;
    }
    public bool RejectedFromPurchaseOrderCompleted(PurchaseOrderInfo purchaseOrderInfo, string userId)
    {
        PurchaseOrderFacade purchaseOrderFacade = new PurchaseOrderFacade();
        purchaseOrderFacade.RejectedFromPurchaseOrderCompleted(purchaseOrderInfo, userId);
        return true;
    }

    public bool SavePurchaseOrderCompleted(PurchaseOrderInfo purchaseOrderInfo, string userId)
    {
        PurchaseOrderFacade purchaseOrderFacade = new PurchaseOrderFacade();
        purchaseOrderFacade.AddPurchaseOrderCompleted(purchaseOrderInfo, userId);
        return true;
    }
    public List<PurchaseOrderInfo> PurchaseOrdersByStateName(string stateName)
    {
        return new PurchaseOrderFacade().PurchaseOrdersByStateName(stateName);
    }
    public List<PurchaseOrderInfo> PurchaseOrders()
    {
        return new PurchaseOrderFacade().PurchaseOrders();
    }
    public PurchaseOrderInfo PurchaseOrdersByWorkFlowInstanceId(int instanceId)
    {
        return new PurchaseOrderFacade().PurchaseOrdersByWorkFlowInstanceId(instanceId);
    }

}
